package cn.com.aiouyi.exception.system;

import cn.com.aiouyi.common.ExceptionCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 通用的系统异常，将记录日志文件和数据库
 * @author hanson
 *
 */
@Getter
@Setter
public class SystemException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    
    /** 异常代码 */
    protected ExceptionCode exceptionCode;
    
    public SystemException(ExceptionCode exceptionCode) {
        super(exceptionCode.toString());
        this.exceptionCode = exceptionCode;
    }
    
    public SystemException(ExceptionCode exceptionCode, String message, Throwable throwable) {
        super(message, throwable);  
        this.exceptionCode = exceptionCode;
    }
    
    public SystemException(String message, Throwable throwable) {
        super(message, throwable);  
    }  
  
    public SystemException(String message) {
        super(message);  
    }  
  
    public SystemException(Throwable throwable) {
        super(throwable);  
    }
    
}
